{{ $version := index .Params 0 }}

{{ with (index $.Site.Data.jdk.versions (index .Params 0)) }}

<table>
  <tbody>
    <tr>
      <th>Release Date</th>
      <td>{{ .ga }}</td>
    </tr>
    <tr>
      <th>Bytecode Version</th>
      <td>{{ .bytecode }}</td>
    </tr>
    {{ if .apidiff }}
    <tr>
      <th>API Changes</th>
      <td>Compare to
        {{ range $elem_index, $elem_val := (sort .apidiff "order" "desc") }}
          {{ if lt 0 $elem_index }} - {{ end }}
          <a href="apidiff/{{ $elem_val.base.version }}">{{ $elem_val.base.version }}</a>
        {{ end }}
      </td>
    </tr>
    {{ end }}
    <tr>
      <th>Documentation</th>
      <td>
        {{ with .documentation.notes }}
          <a href="{{ . }}">Release Notes</a>,
        {{ end }}
        {{ with .documentation.lang }}
          <a href="{{ . }}">Language Spec</a>,
        {{ end }}
        {{ with .documentation.vm }}
          <a href="{{ . }}">VM Spec</a>,
        {{ end }}
        {{ with .documentation.api }}
          <a href="{{ . }}">JavaDoc</a>
        {{ end }}
      </td>
    </tr>
  </tbody>
</table>

{{ end }}

<div class="datasource">
  <a href="{{ $.Site.Params.Sourcebase }}data/jdk/versions/{{ $version }}.json">Data Source</a>
</div>

<h2>Downloads</h2>

<table>
  <thead>
    <tr>
      <th>Vendor</th>
      <th>Product</th>
      <th>License</th>
      <th>Platforms</th>
    </tr>
  </thead>
  <tbody>
  {{ range $.Page.Site.Data.jdk.vendors }}
    {{ $vendor := .}}
    {{ range .products }}
    {{ if in .versions $version }}
    <tr>
      <td><a href="{{ $vendor.url }}">{{ $vendor.name }}</a></td>
      <td><a href="{{ .url }}">{{ .name }}</a></td>
      <td>{{ .license }}</td>
      <td>
        <ul class="tag architecture">
          {{ range .platforms }}
            <li>{{ . }}</li>
          {{ end }}
        </ul>
      </td>
    </tr>
    {{ end }}
    {{ end }}
  {{ end }}
  </tbody>
</table>

<div class="datasource">
  <a href="{{ $.Site.Params.Sourcebase }}data/jdk/vendors.json">Data Source</a>
</div>

